
cc.Class({
    extends: cc.Component,

    properties: {
        backgroundAudio: {
            default: null,
            type: cc.AudioClip,
        },
        lianduiAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        jiaodizhuAudio_Men:{
            default: null,
            type: cc.AudioClip,
        }, 

        bujiaoAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        qiangdizhuAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        buqiangAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },

        oneAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        twoAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        threeAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        fourAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        fiveAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        sixAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        sevenAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        eightAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        nightAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        tenAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        elevenAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        twelveAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        thirteenAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        fourteenAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        fifteenAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        sixteenAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        seventeenAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },

        doubleOneAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        doubleTwoAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        doubleThreeAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        doubleFourAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        doubleFiveAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        doubleSixAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        doubleSevenAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        doubleEightAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        doubleNightAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        doubleTenAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        doubleElevenAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        doubleTwelveAudo_Men: {
            default: null,
            type: cc.AudioClip,
        },
        doubleThirteenAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        doubleFourteenAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        doubleFifteenAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        doubleSixteenAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        doubleSeventeenAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },

        tripleAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        threeAndOneAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        threeAndTwoAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },

        strainghtAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        lianduiAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },

        planeAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        planeWingsAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        rocketAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        passAudio_1_Men: {
            default: null,
            type: cc.AudioClip,
        },
        passAudio_2_Men: {
            default: null,
            type: cc.AudioClip,
        },

        bombAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },
        errorAudio_Men: {
            default: null,
            type: cc.AudioClip,
        },


        //女音

        lianduiAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        jiaodizhuAudio_WoMen:{
            default: null,
            type: cc.AudioClip,
        }, 

        bujiaoAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        qiangdizhuAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        buqiangAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },

        oneAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        twoAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        threeAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        fourAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        fiveAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        sixAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        sevenAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        eightAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        nightAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        tenAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        elevenAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        twelveAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        thirteenAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        fourteenAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        fifteenAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        sixteenAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        seventeenAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },

        doubleOneAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        doubleTwoAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        doubleThreeAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        doubleFourAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        doubleFiveAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        doubleSixAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        doubleSevenAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        doubleEightAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        doubleNightAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        doubleTenAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        doubleElevenAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        doubleTwelveAudo_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        doubleThirteenAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        doubleFourteenAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        doubleFifteenAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        doubleSixteenAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        doubleSeventeenAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },

        tripleAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        threeAndOneAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        threeAndTwoAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },

        strainghtAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        lianduiAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        planeAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        planeWingsAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },

        rocketAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        passAudio_1_WoMen: {
            default: null,
            type: cc.AudioClip,
        },
        passAudio_2_WoMen: {
            default: null,
            type: cc.AudioClip,
        },

        bombAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        },

        errorAudio_WoMen: {
            default: null,
            type: cc.AudioClip,
        }

    },

 

    onLoad () {
        //cc.audioEngine.play(this.backgroundAudio, true, 0.5);
    },

    start () {

    },

    // update (dt) {},
    playBackground(start,volume) {
        // if(start == 0) {
        //     cc.audioEngine.play(this.backgroundAudio, true, volume);
        // }else if(start == 1) {
        //     cc.audioEngine.pause(this.backgroundAudio);
        // }
    },

    playAudio (sex,i) {
        console.log('声音调用成功');
        if(sex == 0) {
            if(i == 101) {              //叫地主
                cc.audioEngine.play(this.jiaodizhuAudio_WoMen, false, 1);
            }else if(i == 102) {        //不叫
                cc.audioEngine.play(this.bujiaoAudio_WoMen, false, 1);
            }else if(i == 103) {        //抢地主
                cc.audioEngine.play(this.qiangdizhuAudio_WoMen, false, 1);
            }else if(i == 104) {        //不抢
                cc.audioEngine.play(this.buqiangAudio_WoMen, false, 1);
            }else if(i == 105) {
                var k = Math.round(Math.random());
                if(k == 0) {
                    cc.audioEngine.play(this.passAudio_1_WoMen, false, 1);
                }else {
                    cc.audioEngine.play(this.passAudio_2_WoMen, false, 1);
                }
            }else if(i == 106) {
                cc.audioEngine.play(this.errorAudio_WoMen, false, 1);
            } else if(i == 3) {          //出牌 3
                cc.audioEngine.play(this.threeAndOneAudio_WoMen, false, 1);
            }else if(i ==  4) {         //出牌 4
                cc.audioEngine.play(this.fourAudio_WoMen, false ,1);
            }else if(i == 5) {
                cc.audioEngine.play(this.fiveAudio_WoMen, false, 1);
            }else if(i == 6) {
                cc.audioEngine.play(this.sixAudio_WoMen, false, 1);
            }else if(i == 7) {
                cc.audioEngine.play(this.sevenAudio_WoMen, false, 1);
            }else if(i == 8) {
                cc.audioEngine.play(this.eightAudio_WoMen, false, 1);
            }else if(i == 9) {
                cc.audioEngine.play(this.nightAudio_WoMen, false, 1);
            }else if(i == 10) {
                cc.audioEngine.play(this.tenAudio_WoMen, false, 1);
            }else if(i == 11) {
                cc.audioEngine.play(this.elevenAudio_WoMen, false, 1);
            }else if(i == 12) {
                cc.audioEngine.play(this.twelveAudio_WoMen, false, 1);
            }else if(i == 13) {
                cc.audioEngine.play(this.thirteenAudio_WoMen, false, 1);
            }else if(i == 14) {
                cc.audioEngine.play(this.fourteenAudio_WoMen, false, 1);
            }else if(i == 15) {
                cc.audioEngine.play(this.fifteenAudio_WoMen, false, 1);
            }else if(i == 16) {
                cc.audioEngine.play(this.sixteenAudio_WoMen, false, 1);
            }else if(i == 17) {
                cc.audioEngine.play(this.seventeenAudio_WoMen, false, 1);
            }else if(i == 30) {     //对三
                cc.audioEngine.play(this.doubleThreeAudio_WoMen, false, 1);
            }else if(i == 40) {     //对4
                cc.audioEngine.play(this.doubleFourAudio_WoMen, false, 1);
            }else if(i == 50) {
                cc.audioEngine.play(this.doubleFiveAudio_WoMen, false, 1);
            }else if(i == 60) {
                cc.audioEngine.play(this.doubleSixAudio_WoMen, false, 1);
            }else if(i == 70) {
                cc.audioEngine.play(this.doubleSevenAudio_WoMen, false, 1);
            }else if( i == 80) {
                cc.audioEngine.play(this.doubleEightAudio_WoMen, false, 1);
            }else if(i == 90) {
                cc.audioEngine.play(this.doubleNightAudio_WoMen, false, 1);
            }else if(i == 100) {
                cc.audioEngine.play(this.doubleTenAudio_WoMen, false, 1);
            }else if(i == 110) {
                cc.audioEngine.play(this.doubleElevenAudio_WoMen, false, 1);
            }else if(i == 120) {
                cc.audioEngine.play(this.doubleTwelveAudo_WoMen, false, 1);
            }else if(i == 130) {
                cc.audioEngine.play(this.doubleThirteenAudio_WoMen, false, 1);
            }else if(i == 140) {
                cc.audioEngine.play(this.doubleFourteenAudio_WoMen, false, 1);
            }else if(i == 150) {    //对2
                cc.audioEngine.play(this.doubleFifteenAudio_WoMen, false, 1);
            }else if(i == 300) {    //三个
                cc.audioEngine.play(this.tripleAudio_WoMen, false, 1);
            }else if(i == 301) {    //三带一
                cc.audioEngine.play(this.threeAndOneAudio_WoMen, false, 1);
            }else if(i == 302) {    //三代二
                cc.audioEngine.play(this.threeAndTwoAudio_WoMen, false, 1);
            }else if(i == 303) {
                cc.audioEngine.play(this.lianduiAudio_WoMen, false, 1);
            }else if(i == 400) { //炸弹
                cc.audioEngine.play(this.bombAudio_WoMen, false, 1);
            }else if(i == 401) { //顺子
                cc.audioEngine.play(this.strainghtAudio_WoMen, false, 1);
            }else if(i == 402) {    //飞机
                cc.audioEngine.play(this.planeAudio_WoMen, false, 1);
            }else if(i == 403) {    //飞机带翅膀
                cc.audioEngine.play(this.planeWingsAudio_WoMen, false, 1);
            }else if(i == 404) {    //连队
                cc.audioEngine.play(this.lianduiAudio_WoMen,false, 1);
            }
        }else if(sex == 1) {
            if(i == 101) {
                cc.audioEngine.play(this.jiaodizhuAudio_Men, false, 1);
            }else if(i == 102) {
                cc.audioEngine.play(this.bujiaoAudio_Men, false, 1);
            }else if(i == 103) {
                cc.audioEngine.play(this.qiangdizhuAudio_Men, false, 1);
            }else if(i == 104) {
                cc.audioEngine.play(this.buqiangAudio_Men, false, 1);
            }else if(i == 105) {
                var k = Math.round(Math.random());
                if(k == 0) {
                    cc.audioEngine.play(this.passAudio_1_Men, false, 1);
                }else {
                    cc.audioEngine.play(this.passAudio_2_Men, false, 1);
                }
            }else if(i == 106) {
                cc.audioEngine.play(this.errorAudio_Men, false, 1);
            } else if(i == 3) {          //出牌 3
                cc.audioEngine.play(this.threeAudio_Men, false, 1);
            }else if(i ==  4) {         //出牌 4
                cc.audioEngine.play(this.fourAudio_Men, false, 1);
            }else if(i == 5) {
                cc.audioEngine.play(this.fiveAudio_Men, false, 1);
            }else if(i == 6) {
                cc.audioEngine.play(this.sixAudio_Men, false, 1);
            }else if(i == 7) {
                cc.audioEngine.play(this.sevenAudio_Men, false, 1);
            }else if(i == 8) {
                cc.audioEngine.play(this.eightAudio_Men, false, 1);
            }else if(i == 9) {
                cc.audioEngine.play(this.nightAudio_Men, false, 1);
            }else if(i == 10) {
                cc.audioEngine.play(this.tenAudio_Men, false, 1);
            }else if(i == 11) {
                cc.audioEngine.play(this.elevenAudio_Men, false, 1);
            }else if(i == 12) {
                cc.audioEngine.play(this.twelveAudio_Men, false, 1);
            }else if(i == 13) {
                cc.audioEngine.play(this.thirteenAudio_Men, false, 1);
            }else if(i == 14) {
                cc.audioEngine.play(this.fourteenAudio_Men, false, 1);
            }else if(i == 15) {
                cc.audioEngine.play(this.fifteenAudio_Men, false, 1);
            }else if(i == 16) {
                cc.audioEngine.play(this.sixteenAudio_Men, false, 1);
            }else if(i == 17) {
                cc.audioEngine.play(this.seventeenAudio_Men, false, 1);
            }else if(i == 30) {     //对三
                cc.audioEngine.play(this.doubleThreeAudio_Men, false, 1);
            }else if(i == 40) {     //对4
                cc.audioEngine.play(this.doubleFourAudio_Men, false, 1);
            }else if(i == 50) {
                cc.audioEngine.play(this.doubleFiveAudio_Men, false, 1);
            }else if(i == 60) {
                cc.audioEngine.play(this.doubleSixAudio_Men, false, 1);
            }else if(i == 70) {
                cc.audioEngine.play(this.doubleSevenAudio_Men, false, 1);
            }else if( i == 80) {
                cc.audioEngine.play(this.doubleEightAudio_Men, false, 1);
            }else if(i == 90) {
                cc.audioEngine.play(this.doubleNightAudio_Men, false, 1);
            }else if(i == 100) {
                cc.audioEngine.play(this.doubleTenAudio_Men, false, 1);
            }else if(i == 110) {
                cc.audioEngine.play(this.doubleElevenAudio_Men, false, 1);
            }else if(i == 120) {
                cc.audioEngine.play(this.doubleTwelveAudo_Men, false, 1);
            }else if(i == 130) {
                cc.audioEngine.play(this.doubleThirteenAudio_Men, false, 1);
            }else if(i == 140) {
                cc.audioEngine.play(this.doubleFourteenAudio_Men, false, 1);
            }else if(i == 150) {    //对2
                cc.audioEngine.play(this.doubleFifteenAudio_Men, false, 1);
            }else if(i == 300) {    //三个
                cc.audioEngine.play(this.tripleAudio_Men, false, 1);
            }else if(i == 301) {    //三带一
                cc.audioEngine.play(this.threeAndOneAudio_Men, false, 1);
            }else if(i == 302) {    //三代二
                cc.audioEngine.play(this.threeAndTwoAudio_Men, false, 1);
            }else if(i == 303){
                cc.audioEngine.play(this.lianduiAudio_Men, false, 1);
            }else if(i == 400) { //炸弹
                cc.audioEngine.play(this.bombAudio_Men, false, 1);
            }else if(i == 401) { //顺子
                cc.audioEngine.play(this.strainghtAudio_Men, false, 1);
            }else if(i == 402) {    //飞机
                cc.audioEngine.play(this.planeAudio_Men, false, 1);
            }else if(i == 403) {
                cc.audioEngine.play(this.planeWingsAudio_Men, false, 1);
            }else if(i == 404) {
                cc.audioEngine.play(this.lianduiAudio_Men, false, 1);
            }
        }
    }
});



module.exports = {
     Class: this,
}